-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loading delay adminhtml #2426
Add loading delay adminhtml #2426
Conversation
67326b7
to
ae9e38f
Compare
I reverted the Internet Explorer stuff. It was breaking and I will create a new PR to 20.0. |
Thank you @justinbeaty. I can confirm that the change in this PR solves the annoying issue in the Backend interface, when even though you have a high-performance and fast server, you always receive flashes over the content of the page that it is waiting. I have sorted columns, quick switches between categories and many others, it is obviously something else. I think that the value of 100 ms is fine, at least in my case it did not appear at all. As for making the value configurable in the interface, if it is a complex task it is not worth the effort. If in time we find that it is necessary to modify it we can make a PR that increases the value to solve that issues whether it will remain 100 ms or it will be 500 ms, we will see in time. In any case, now I could get used to the OpenMage theme (if better colors and font), I avoided it only because these waiting were much more visually aggressive than in the Magento theme. Now it is a joy for the eyes, it's a pity that we spent so long with this issue. |
I made the change in production. At the value of 100 ms very few sections still display the waiting dial. If I increase the value to 150 ms the number decreases even more. It's a real relief not to see the waiting dial like a flash anymore. We will certainly not please everyone with the value of 100 ms. If we leave it hardcoded few will know about it. Maybe we should analyze that the value is configurable in the Backend. I would leave it at 100 ms now for testing. |
The value shouldn't be too high, but I can look into making it configurable. One thing to test before merging - in dev environment try to set the value to something like If that's possible, we can work around it by making the overlay disable things on screen right away, but not visible until the timeout. |
In Backend > Dashboard when I click on "Most Viewed Products" tab the waiting dial appears. It is the only one I discovered for 100 ms. I will try your test and let's see what is happening. I will look in the existing code if a configuration variable is used in any JavaScript file. If I find it, I will analyze the implementation. The value is easy to take to a PHTML file used everywhere in the Backend and from there to be taken over by the script. But maybe there is already a solution to be taken directly? |
There's no way to output a config variable directly into JS. You are right that there are other adminhtml variables outputted into a phtml file somewhere. I'm just not sure where off the top of my head. |
@addison74 I have added the value to the configuration dashboard. It is in: |
I am testing now to see if I can break anything by clicking other buttons before the loading mask would show up. |
Good job. This change really has a visual impact for all Backend users. I will test the changes and tell you my opinion. If you don't add anything and everything is fine I will ask you if I can approve it. |
|
@addison74 Thanks for the reminder, I forgot about the translations. Maybe: Number of milliseconds to delay showing the loading indicator. The default value is "100". Enter an empty value to disable the loading indicator delay. Adapted from #2308 |
d828231
to
5df1c72
Compare
585b83d
to
428df90
Compare
I changed how the loading mask appears. Basically I was worried about it being possible to do actions on the page when the loading indicator should have prevented any clicks (but was delayed due to this PR). So now the Despite wanting to be able to do this in pure CSS, I did have to add a new @addison74 sorry to make you test this again, but please pull the latest commits and let me know if all looks okay. |
Comments
Question |
Empty and "0" should be the same thing, a 0 millisecond timeout. Or in other words the old behavior where the indicator shows up immediately. |
I checked again and the changes made are correct. I appreciate that you made a validation of the value, to be greater than or equal to zero. Thank you for your work @justinbeaty. I am waiting for you to make the change in that phrase in the comment. I would choose "An empty value disables the delay", because it is obvious that reference is made to the Loading Indicator. |
@addison74 fixed translations. |
82b5eef
to
2e33abd
Compare
test right now, it works perfect although to me 100msec didn't do the trick, I still see the loading splash screen, with 200msec it went away (on my local dev environment on mac+homebrew) |
@fballiano we can change it to 200ms, I think it makes @addison74 happier too. |
I'd like that :-) |
done @addison74 your reviews was dismissed. You can check changes here. |
Description (*)
As described in #2419 it can be annoying on a fast connection that the admin dashboard "Please wait" message shows up for very fast AJAX requests.
This PR sets a timeout on showing the loading indicator so that it only shows up after 100ms. If the request is quicker than that, the indicator will not show.
I also removed some Internet Explorer stuff...
Paging @addison74 please test :)
Possible TODO, allow this value to be configurable? I'm not really sure it's needed and would cause some extra complexity because we need to output the variable value in a phtml file somewhere so that we can read it in JS. The default of 100ms is a pretty commonly used debounce value.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
foobar@example.com
. The indicator should not show up if your server is fast (especially if its local)Foo Bar
. The indicator should show up if you have a good amount of customers.Questions or comments
Contribution checklist (*)